﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace POB.Gameplay.Components
{
    class Speed : Component
    {
        Vector2 speed;

        public Speed(XElement unitElement, World world, Player player, Unit unit)
            : base(unitElement, world, player, unit)
        {
            speed = unitElement.Value.ToVector2();
        }

        public override void Update(float time)
        {
            Unit.Position = Unit.Position + speed * time;

            base.Update(time);
        }
    }
}
